Skip to content

Conversation

@daniel-lxs
Copy link
Member

@daniel-lxs daniel-lxs commented Sep 1, 2025

Problem

CI e2e tests were failing with ETIMEDOUT errors when downloading VS Code binaries from Microsoft's CDN during test runs.

Root Cause

The @vscode/test-electron package downloads VS Code binaries on every CI run, which:

  • Creates unnecessary network traffic
  • Is susceptible to transient network issues
  • Increases test execution time

Solution

This PR implements three key mitigations:

1. Caching VS Code Test Runtime

  • Added GitHub Actions cache for VS Code binaries
  • Cache key based on OS, architecture, and VS Code version
  • Prevents redundant downloads across CI runs

2. Pinned VS Code Version

  • Set specific version (1.101.2) instead of 'stable'
  • Ensures deterministic caching
  • Configurable via VSCODE_VERSION environment variable

3. Pre-download Step

  • Added dedicated download step before tests
  • Isolates download failures from test failures
  • Makes CI logs clearer for debugging

Changes

  • Modified .github/workflows/code-qa.yml to add caching and pre-download step
  • Updated apps/vscode-e2e/src/runTest.ts to use pinned version with env var fallback

Testing

  • Changes will be validated in CI once merged
  • Cache effectiveness can be monitored in subsequent runs

Fixes the network timeout issues that have been causing intermittent CI failures.


Important

Fixes CI e2e test timeouts by caching VS Code binaries, pinning version, and adding a pre-download step.

  • Caching:
    • Added GitHub Actions cache for VS Code binaries in .github/workflows/code-qa.yml.
    • Cache key based on OS, architecture, and VS Code version.
  • Version Pinning:
    • Set VS Code version to 1.101.2 in .github/workflows/code-qa.yml and runTest.ts.
    • Configurable via VSCODE_VERSION environment variable.
  • Pre-download Step:
    • Added pre-download step with retry logic in .github/workflows/code-qa.yml.
    • Isolates download failures from test failures.
  • Misc:
    • Updated runTest.ts to use pinned version with environment variable fallback.

This description was created by Ellipsis for d51ccb3. You can customize this summary. It will automatically update as commits are pushed.

- Add caching for VS Code test runtime to prevent re-downloads
- Pin VS Code version to 1.101.2 for deterministic caching
- Add pre-download step to isolate download failures from test failures
- Configure version via VSCODE_VERSION environment variable

This fixes the network timeout issues occurring when @vscode/test-electron
attempts to download VS Code from Microsoft's CDN during CI runs.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Sep 1, 2025
Copy link

@roomote roomote bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! This PR effectively addresses the CI e2e test timeout issues with a well-thought-out approach. The implementation using caching, version pinning, and pre-download isolation is clean and follows GitHub Actions best practices. I've left some suggestions inline that could further improve the robustness of the solution.

path: apps/vscode-e2e/.vscode-test
key: ${{ runner.os }}-vscode-test-${{ env.VSCODE_VERSION }}
restore-keys: |
${{ runner.os }}-vscode-test-
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache restore-keys fallback to just ${{ runner.os }}-vscode-test- could potentially restore an incompatible cache from a different VS Code version. Is this fallback truly beneficial, or might it cause issues if the cached version doesn't match the expected one? Consider whether a strict version match would be safer.

key: ${{ runner.os }}-vscode-test-${{ env.VSCODE_VERSION }}
restore-keys: |
${{ runner.os }}-vscode-test-
- name: Pre-download VS Code test runtime
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since network issues are often transient, would it be helpful to add retry logic here? Something like:

Suggested change
- name: Pre-download VS Code test runtime
- name: Pre-download VS Code test runtime
working-directory: apps/vscode-e2e
run: |
for i in 1 2 3; do
node -e "
const { downloadAndUnzipVSCode } = require('@vscode/test-electron');
downloadAndUnzipVSCode({ version: process.env.VSCODE_VERSION || '1.101.2' })
.then(() => {
console.log('✅ VS Code test runtime downloaded successfully');
process.exit(0);
})
.catch(err => {
console.error('❌ Failed to download VS Code (attempt ' + $i + '):', err);
if ($i === 3) process.exit(1);
});
" && break || sleep 5
done

working-directory: apps/vscode-e2e
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local
- name: Set VS Code test version
run: echo "VSCODE_VERSION=1.101.2" >> $GITHUB_ENV
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The VS Code version is specified both here as an environment variable and as a fallback in line 103. To ensure consistency and avoid potential mismatches, could we reference the environment variable directly in the Node script without the fallback? This would ensure a single source of truth.

- name: Create .env.local file
working-directory: apps/vscode-e2e
run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local
- name: Set VS Code test version
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a comment explaining why version 1.101.2 was chosen specifically. This would help future maintainers understand when and why to update it. For example:

Suggested change
- name: Set VS Code test version
- name: Set VS Code test version
# Using a specific version instead of 'stable' to ensure deterministic caching
# Update this version periodically to match the minimum supported VS Code version
run: echo "VSCODE_VERSION=1.101.2" >> $GITHUB_ENV

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Sep 1, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Needs Review] in Roo Code Roadmap Sep 1, 2025
@hannesrudolph hannesrudolph added PR - Needs Review and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Sep 1, 2025
- Remove cache restore-keys fallback to prevent loading incompatible versions
- Add retry logic (3 attempts) to handle transient network failures
- Add 5-second delay between retry attempts

These changes address the high-priority concerns raised by roomote to make
the CI pipeline more robust against network issues while ensuring version
consistency.
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 1, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 5, 2025
@mrubens mrubens merged commit 687b379 into main Sep 5, 2025
16 checks passed
@mrubens mrubens deleted the fix/ci-e2e-vscode-download-timeout branch September 5, 2025 18:54
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Sep 5, 2025
@github-project-automation github-project-automation bot moved this from PR [Needs Review] to Done in Roo Code Roadmap Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working lgtm This PR has been approved by a maintainer PR - Needs Review size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants